package xxf.person.core.view;

import java.util.Locale;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.view.freemarker.FreeMarkerView;

import freemarker.template.Configuration;

/**
* @ClassName: StructureView
* @Description: TODO
* @author YQ
* @date 2013年9月16日 上午9:36:49
*/
public class StructureView extends FreeMarkerView{

	/**
	 * Custom Override FreeMarkerView method.
	 */
	@Override
	public boolean checkResource(Locale locale) throws Exception {
		// TODO Auto-generated method stub
		return super.checkResource(locale);
	}

	/**
	 *
	 */
	@Override
	protected Configuration getConfiguration() {
		// TODO Auto-generated method stub
		return super.getConfiguration();
	}




	/**
	 * Custom Method
	 */
	@Override
	protected void doRender(Map<String, Object> model,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {

		//Custom global properties for web.
		//model.put("static", PropertiesUtil.get("remote.static.address"));
		//model.put("webServer", PropertiesUtil.get("remote.web.address"));

		//Provide functional export model data in the request attributes.
		exposeModelAsRequestAttributes(model, request);

		//Custom global properties for web.
		String webContextUrl = request.getLocalName()+":"+request.getLocalPort()+request.getContextPath();
		model.put("webContextUrl", webContextUrl);
		model.put("serverName", request.getContextPath());



		super.doRender(model, request, response);
	}

}
